<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * materialout.php
 * @author ranuandra
 *
 * 17 Agu 2011 22:59:06
 *
 * 
 */

class Model_Materialout extends ORM
{
	
						
	protected $_has_many = array(
								'detailmaterialout' 	=> array('model' => 'detailmaterialout')
							);
	
	private $_form = array( 'tgl'				=> '',
							'no_order'			=> '',
							'no_charge'			=> ''
							);
							
	private $_field = array(
						'tgl', 'no_order', 'no_charge'
					);

	public function rules()
	{
		return array(
			 'tgl' 	   => array(
			 						array('min_length', array(':value', 0)),
			 ),
			'no_order' 	   => array(
			 						array('min_length', array(':value', 0)),
			 ),
			'no_charge' 	   => array(
			 						array('min_length', array(':value', 0)),
			 ),

		);
	}
	
	public function get_form()
	{
		return $this->_form;
	}
	
	public function get_field()
	{
		return $this->_field;
	}
	
	public function create_materialout($values)
	{
		return $this->values($values, $this->_field)->create();
	}
}